package response;

import javax.servlet.ServletException;
import javax.servlet.http.*;
import java.io.IOException;

/**
 * 演示设置请求头禁用浏览器缓存
 */
public class DisableCacheHeader extends HttpServlet{

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setIntHeader("Expires",-1);
        resp.setHeader("Cookie-control","no-cache");
        resp.setHeader("Progma","nocache");
    }
}
